// pages/member/weidian/index/index.js
import { PNT, setNavBarTitle, showToast, pushPagePath, scrollLoadList } from "../../../../utils/utils";
import { GetDrpInfo} from "../../../../utils/apis";


Page({

  /**
   * 页面的初始数据
   */
  data: {
    images:'/images/head_default_large.png',
    shop_name:'xx小店',
    credit_id:'铜牌',
    create_time:'2019-10-10',
    sr:200 ,
    shop_money:1587.21,
    shop_money1:234.10,
    jj:250,
  },

  /**
    * 页面跳转
    * @author darlang
    */
  pushPath(e) {
    const items = e.currentTarget.dataset;
    const pathData = [
      { type: 'tzdd', path: '/pages/member/weidian/order/index'},
      
      { type: 'yjmx', path: '/pages/member/weidian/yjmx/index' },
      { type: 'team', path: '/pages/member/weidian/team/index' },
      { type: 'mingpian', path: '/pages/member/invite/index/index' },
     
    ];
    pushPagePath(e, pathData);
  },
  /**
    * 获取店铺信息
    * @author darlang
    */
  getDrpInfo(){
    var info = wx.getStorageSync('userInfo')
    
    let data = {};
    data.user_id = info.user_id
    GetDrpInfo(data).then(res=>{
      wx.hideLoading();
      if(res.error_code == 10000){
        
        this.setData({
          info:res.data,
        })
      }
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.showLoading({
      title: '数据加载中',
    })
    setNavBarTitle(PNT.member.main);
    this.loginModal = this.selectComponent("#login-modal");
    if(!this.loginModal.check()){
      return false;
    }
    this.getDrpInfo();

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})